App({
  onLaunch: function () {
    //登陆
    wx.login({
      success: async (res) => {
        if (res.code) {
          console.log('登录成功！' + res.code)
        } else {
          console.log('登录失败！' + res.errMsg)
        }
      }
    })
    //获取缓存中的登录信息
    var that=this;
    wx.getStorage({
      key: 'userInfo',
      success: function (res) {
        var userInfo=res.data;
        var date = new Date(userInfo.expiringDate);
        if (date-1>new Date()){
          that.globalData.userInfo = res.data;
        }
      },
    })
  },
  globalData: {
    userInfo: null,
    appId:'wxfad62e2ff0264d47',
    // host: 'https://www.inoth.site/api',
     host: 'http://localhost:6433/api',
  },
})